﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="listdis.aspx.cs" Inherits="dzs.Web.Admin.mp.listdis" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" src="/js/CheckBox.js" type="text/javascript"></script>
     <link href="../../jquery-ui.min.css" rel="stylesheet" />    
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtKeyword2.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
    <style type="text/css">
        .auto-style1 {
            width: 436px;
        }
        .auto-style2 {
            width: 162px;
        }
    </style>
    <%-- <script language="javascript" type="text/javascript">   
        function showbtn()
        {
            var val = $("#<%=ddlstatus.ClientID %>  option:selected").text();
            if (val == "未分配")
            {
                $("#dis").show();
                $("#del").hide();
            }
            else if (val == "已分配")
            {
                $("#dis").hide();
                $("#del").show();
            }

        }
        $(function () { showbtn();});
        </script>--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td align="right" class="auto-style2" >
                         <b>配送状态：</b><asp:DropDownList ID="ddlstatus" runat="server" >
                             <asp:ListItem Value="0">所有</asp:ListItem>
                             <asp:ListItem Selected="True" Value="1">未分配</asp:ListItem>
                             <asp:ListItem Value="2">已分配</asp:ListItem>
                         </asp:DropDownList></td>
                    <td class="auto-style1">                       
                       <b>项目名：</b> <asp:TextBox ID="txtKeyword2" runat="server" Width="84px"></asp:TextBox>   <b>物料描述：</b>
                    <asp:TextBox ID="txtKeyword" runat="server" Width="91px"></asp:TextBox>
                    &nbsp;<asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    &nbsp;</td>
                    <td class="tdbg">
                        分配日期为：<asp:Label ID="lblmsg" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
            </table>
            <!--Search end-->
            <br />
            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="1500px" 
            BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" 
            GridLines="None"  OnPageIndexChanging ="gridView_PageIndexChanging"
                     DataKeyNames="monthSupplyPlanId" 
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" 
            onrowdatabound="gridView_RowDataBound" PageSize="20">
                    <Columns>
                    <asp:TemplateField ControlStyle-Width="30" HeaderText="选择"    >
                        <HeaderTemplate>
                                    <input id="Checkbox1" type="checkbox" onclick="chall(this)" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="DeleteThis" runat="server" />
                                </ItemTemplate>

<ControlStyle Width="30px"></ControlStyle>
                            </asp:TemplateField> 
                            
		<asp:BoundField DataField="proid" HeaderText="项目编号"  ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="projectName" HeaderText="项目名"  ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="material" HeaderText="物料描述"  ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="thisMonthCount" HeaderText="本月供应量" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="supplyDate" DataFormatString="{0:D}" HeaderText="供应年月" />
                        <asp:BoundField DataField="sname" HeaderText="供应商" />
                            
                            <asp:BoundField DataField="user_name" HeaderText="配送管理员" />
                            
                            <asp:TemplateField HeaderText="是否等待发货前质量确认">
                                <ItemTemplate>
                                    <asp:Label ID="lbl_isGoodsQualityStatus" runat="server" 
                                        Text='<%# Bind("isGoodsQualityStatus") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" 
                                        Text='<%# Bind("isGoodsQualityStatus") %>'></asp:TextBox>
                                </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="发货前质量确认">
                            <ItemTemplate>
                                <asp:Label ID="lbl_goodsQualityStatus" runat="server" 
                                    Text='<%# Bind("goodsQualityStatus") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" 
                                    Text='<%# Bind("goodsQualityStatus") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                            
                            <asp:HyperLinkField HeaderText="详细" ControlStyle-Width="50" DataNavigateUrlFields="monthSupplyPlanId" DataNavigateUrlFormatString="../../monthSupplayPlan/Show.aspx?id={0}"
                                Text="详细"  >
<ControlStyle Width="50px"></ControlStyle>
                        </asp:HyperLinkField>
                        </Columns>

                    <PagerStyle CssClass="mypager" />

<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>
               <table border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
                <tr>
                    <td style="width: 1px;">                        
                    </td>
                    <td align="left">
                        
                            <asp:Panel ID="dis" runat="server">
                        <asp:DropDownList ID="ddldis" runat="server">
                        </asp:DropDownList>
&nbsp;<asp:Button ID="btnDelete" runat="server" Text="分配" OnClick="btnDelete_Click" OnClientClick="return chtest()"/>   
                            </asp:Panel>
                        <asp:Panel ID="del" runat="server" Visible="False">

                                             
&nbsp;<asp:Button ID="btndeldis" runat="server" Text="删除" OnClick="btndeldis_Click"/>   
                            </asp:Panel>                   
                    </td>
                </tr>
            </table>
</asp:Content>
